import java.io.PrintWriter;
import java.io.File;

class Test {
	public static void main(String[] args) throws Exception {
		int i=0;
		File f;
		do {
			i++;
			f=new File("/tmp/test-" +i+ ".txt");
		} while(f.exists());
		try(PrintWriter w=new PrintWriter(f)) {
			w.print("hello ");
			w.println("world");
			w.println(i*100);
			w.close();
		}
	}
}
